/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 80013
 Source Host           : localhost
 Source Database       : db_rbac

 Target Server Type    : MySQL
 Target Server Version : 80013
 File Encoding         : utf-8

 Date: 09/17/2019 23:49:55 PM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `t_permission`
-- ----------------------------
DROP TABLE IF EXISTS `t_permission`;
CREATE TABLE `t_permission` (
  `id` varchar(80) NOT NULL COMMENT '主键ID',
  `name` varchar(20) DEFAULT NULL COMMENT '权限名称',
  `url` varchar(40) DEFAULT NULL COMMENT 'URL路径',
  `type` int(11) DEFAULT NULL COMMENT '类型',
  `parent_id` varchar(18) DEFAULT NULL COMMENT '父级ID',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='权限表';

-- ----------------------------
--  Records of `t_permission`
-- ----------------------------
BEGIN;
INSERT INTO `t_permission` VALUES ('186407547886899200', '用户模块', null, null, null, '2019-09-17 23:34:44', '2019-09-17 23:34:44'), ('186407547886899201', '查询用户', 'user:selectUser', '1', '186407547886899200', '2019-09-17 23:37:22', '2019-09-17 23:37:22'), ('186407547886899202', '添加用户', 'user:addUser', '1', '186407547886899200', '2019-09-17 23:37:23', '2019-09-17 23:37:23'), ('186407547886899203', '修改用户', 'user:updateUser', '1', '186407547886899200', '2019-09-17 23:37:25', '2019-09-17 23:37:25'), ('186407547886899204', '删除用户', 'user:deleteUser', '1', '186407547886899200', '2019-09-17 23:37:26', '2019-09-17 23:37:26');
COMMIT;

-- ----------------------------
--  Table structure for `t_role`
-- ----------------------------
DROP TABLE IF EXISTS `t_role`;
CREATE TABLE `t_role` (
  `id` varchar(80) NOT NULL COMMENT '主键ID',
  `name` varchar(20) DEFAULT NULL COMMENT '角色名称',
  `remarks` varchar(30) DEFAULT NULL COMMENT '备注',
  `create_by` varchar(18) DEFAULT NULL COMMENT '创建者',
  `update_by` varchar(18) DEFAULT NULL COMMENT '更新者',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色表';

-- ----------------------------
--  Records of `t_role`
-- ----------------------------
BEGIN;
INSERT INTO `t_role` VALUES ('186409700189802500', 'ADMIN', '超级管理员', '186407547882704900', '186407547882704900', '2019-09-17 23:38:44', '2019-09-17 23:38:44'), ('186409700189802501', 'TEACHER', '教师', '186407547882704900', '186407547882704900', '2019-09-17 23:38:48', '2019-09-17 23:38:48'), ('186409700189802502', 'STUDENT', '学生', '186407547882704900', '186407547882704900', '2019-09-17 23:38:56', '2019-09-17 23:38:56');
COMMIT;

-- ----------------------------
--  Table structure for `t_role_permission`
-- ----------------------------
DROP TABLE IF EXISTS `t_role_permission`;
CREATE TABLE `t_role_permission` (
  `id` varchar(80) NOT NULL COMMENT '主键ID',
  `role_id` varchar(18) DEFAULT NULL COMMENT '角色ID',
  `permission_id` varchar(18) DEFAULT NULL COMMENT '权限ID',
  `remarks` varchar(30) DEFAULT NULL COMMENT '备注',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色权限中间表';

-- ----------------------------
--  Records of `t_role_permission`
-- ----------------------------
BEGIN;
INSERT INTO `t_role_permission` VALUES ('186411052173365250', '186409700189802500', '186407547886899200', 'ADMIN-用户模块', '2019-09-17 23:46:33', '2019-09-17 23:46:33'), ('186411052173365251', '186409700189802500', '186407547886899201', 'ADMIN-查询用户', '2019-09-17 23:46:50', '2019-09-17 23:46:50'), ('186411052173365252', '186409700189802500', '186407547886899202', 'ADMIN-添加用户', '2019-09-17 23:47:07', '2019-09-17 23:47:07'), ('186411052173365253', '186409700189802500', '186407547886899203', 'ADMIN-修改用户', '2019-09-17 23:47:13', '2019-09-17 23:47:13'), ('186411052173365254', '186409700189802500', '186407547886899204', 'ADMIN-删除用户', '2019-09-17 23:47:15', '2019-09-17 23:47:15');
COMMIT;

-- ----------------------------
--  Table structure for `t_user`
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user` (
  `id` varchar(80) COLLATE utf8mb4_bin NOT NULL COMMENT '主键ID',
  `username` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '账号',
  `password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '密码',
  `really_name` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '真实姓名',
  `avatar` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '头像',
  `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '手机',
  `email` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '邮箱',
  `sex` int(11) DEFAULT NULL COMMENT '性别 1:男 2:女',
  `is_enabled` tinyint(1) DEFAULT '1' COMMENT '是否被删除,true表示用户未被删除',
  `is_account_non_expired` tinyint(1) DEFAULT '1' COMMENT '账号是否没过期,true表示账号没过期',
  `is_account_non_locked` tinyint(1) DEFAULT '1' COMMENT '账号是否没被锁定,true表示账号没被冻结',
  `is_credentials_non_expired` tinyint(1) DEFAULT '1' COMMENT '密码是否过期,true表示密码没过期',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='用户表';

-- ----------------------------
--  Records of `t_user`
-- ----------------------------
BEGIN;
INSERT INTO `t_user` VALUES ('186407547882704900', 'admin', '111111', '超级管理', 'https://q.qlogo.cn/qqapp/101235792/73EE253B488FB6033AD6A164362F26E6/100', '13222222222', 'admin@qq.com', '1', '1', '1', '1', '1', '2018-11-28 10:00:11', '2018-11-28 09:00:06'), ('186407547882704901', 'zhansgan', '111111', '张三', 'https://thirdqq.qlogo.cn/qqapp/101235792/F2407217C117BC8E13904E221D393FDC/100', '13333333333', 'zhangsan@qq.com', '1', '1', '1', '1', '1', '2018-11-13 15:17:22', '2018-11-26 22:50:04'), ('186407547882704902', 'lisi', '111111', '李四', 'https://thirdqq.qlogo.cn/qqapp/101235792/F2407217C117BC8E13904E221D393FDC/100', '13222222222', 'lisi@qq.com', '1', '1', '1', '1', '1', '2018-11-28 10:00:13', '2018-11-26 22:50:04'), ('186407547882704903', 'wangwu', '111111', '王五', 'https://thirdqq.qlogo.cn/qqapp/101235792/F2407217C117BC8E13904E221D393FDC/100', '13222222222', 'wangwu@qq.com', '2', '0', '1', '1', '1', '2018-11-28 10:00:15', '2018-11-28 08:46:15'), ('186407547882704904', 'zhaoliu', '111111', '赵六', 'https://thirdqq.qlogo.cn/qqapp/101235792/F2407217C117BC8E13904E221D393FDC/100', '13222222222', 'zhaoliu@qq.com', '1', '1', '0', '1', '1', '2018-11-28 10:00:17', '2018-11-28 08:38:50'), ('186407547882704905', 'songqi', '111111', '宋七', 'https://thirdqq.qlogo.cn/qqapp/101235792/F2407217C117BC8E13904E221D393FDC/100', '13222222222', 'songqi@qq.com', '2', '1', '1', '0', '1', '2018-11-28 10:00:19', '2018-11-28 08:43:56'), ('186407547882704906', 'ceshi1', '111111', '测试1', 'https://q.qlogo.cn/qqapp/101235792/73EE253B488FB6033AD6A164362F26E6/100', '13222222222', '43@cc.cc', '2', '1', '1', '1', '0', '2018-11-28 10:00:20', '2018-11-28 10:19:14'), ('186407547882704907', 'ceshi2', '111111', '测试2', 'https://q.qlogo.cn/qqapp/101235792/73EE253B488FB6033AD6A164362F26E6/100', '13222222222', '4321@qq.cc', '2', '1', '0', '1', '1', '2018-11-28 10:00:22', '2018-11-28 10:19:26');
COMMIT;

-- ----------------------------
--  Table structure for `t_user_role`
-- ----------------------------
DROP TABLE IF EXISTS `t_user_role`;
CREATE TABLE `t_user_role` (
  `id` varchar(80) NOT NULL COMMENT '主键ID',
  `user_id` varchar(18) DEFAULT NULL COMMENT '用户ID',
  `role_id` varchar(18) DEFAULT NULL COMMENT '角色ID',
  `remarks` varchar(30) DEFAULT NULL COMMENT '备注',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户角色中间表';

-- ----------------------------
--  Records of `t_user_role`
-- ----------------------------
BEGIN;
INSERT INTO `t_user_role` VALUES ('186410166516715520', '186407547882704900', '186409700189802500', 'admin-ADMIN', '2019-09-17 23:49:05', '2019-09-17 23:49:05'), ('186410166520909824', '186407547882704900', '186409700189802501', 'admin-TEACHER', '2019-09-17 23:49:10', '2019-09-17 23:49:10'), ('186410166520909825', '186407547882704900', '186409700189802502', 'admin-STUDENT', '2019-09-17 23:49:15', '2019-09-17 23:49:15'), ('186410166520909826', '186407547882704901', '186409700189802501', 'zhangsan-TEACHER', '2019-09-17 23:49:25', '2019-09-17 23:49:25'), ('186410166520909827', '186407547882704902', '186409700189802502', 'lisi-STUDENT', '2019-09-17 23:49:36', '2019-09-17 23:49:36'), ('186410166520909828', '186407547882704903', '186409700189802502', 'wangwu-STUDENT', '2019-09-17 23:49:40', '2019-09-17 23:49:40');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
